from django.urls import converters


# 定义判断用户名是否符合要求的转换器 正则[a-zA-Z0-9_-]{5,20}
class UsernameConverter:
    regex = '[a-zA-Z0-9_-]{5,20}'

    def to_python(self, value):
        return value


# 定义判断手机号是否符合要求的转换器
class MobileConverter:
    regex = '1[3-9]\d{9}'

    def to_python(self, value):
        return value


class UuidConverter:
    regex = '[\w-]+'

    def to_python(self, value):
        return value


